import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 员工信息
 */
@Entity('staff_info')
export class StaffInfoEntity extends BaseEntity {
  @Column({ comment: '姓名', length: 50 })
  name: string;

  @Column({ comment: '性别', dict: ['男', '女', '未知'], default: 2 })
  gender: number;

  @Index({ unique: true })
  @Column({ comment: '手机号', length: 20, nullable: true })
  phone: string;

  @Column({ comment: '邮箱', length: 100, nullable: true })
  email: string;

  @Index()
  @Column({ comment: '所属机构ID' })
  orgId: number;

  @Column({ comment: '部门', length: 50, nullable: true })
  department: string;

  @Column({ comment: '职位', length: 50, nullable: true })
  position: string;

  @Index({ unique: true })
  @Column({ comment: '工号', length: 50 })
  staffNo: string;

  @Column({ comment: '入职时间', type: 'date', nullable: true })
  entryDate: Date;

  @Column({ comment: '员工状态', dict: ['离职', '在职'], default: 1 })
  status: number;
}
